home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Q: free() function
- Date: 7 Apr 96 23:19:04 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.828919144@rscernix>
- References: <4k9ai7$rck@tibalt.supernet.ab.ca>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4k9ai7$rck@tibalt.supernet.ab.ca> lts@news.supernet.ab.ca (Len Starrenburg) writes:
-
- >When dynamically allocating memory for a series of strings and storing
- >the addresses in a char pointer array, can all the allocated memory be
- >freed simply using "free(array)" or does "free(array[x])" have to be
- >executed for each pointer in the array.
-
- The only way to free a memory block allocated via [cm]alloc or realloc
- is to pass the pointer returned by the respective function to free
- or realloc.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-